<meta chartset="utf-8">
<?php
// class CalClass {

	function addCal($num1, $num2, $operator) {

		$res = 0;

		switch ($operator){
			case '+':
				$res = $num1 + $num2;
				break;
			case '-':
				$res = $num1 - $num2;
				break;
			case '*':
				$res = $num1 * $num2;
				break;
			case '/':
				$res = $num1 / $num2;
				break;
			default:
				# code...
				break;
		}

		echo "输出结果为".$res;
	}

	$n1 = $_GET["num1"];
	$n2 = $_GET["num2"];
	echo "输入".$n1;

// }
